package com.Example;

import com.alibaba.fastjson.JSONObject;
import com.client.Client;
import com.client.RepChainClient;
import org.apache.http.HttpResponse;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class TestCallBack {
    public static void main(String[] args) {
//        new Commit().invoke();
        RepChainClient client = new RepChainClient();
        client.setUrl("Http://192.168.2.69:8081/chaininfo");
        System.out.println(client.getUrl());
        HttpResponse response = client.doGet();
        JSONObject jsonObject = RepChainClient.doGet(client.getUrl());
        try {
            System.out.println(EntityUtils.toString(response.getEntity()));
        } catch (IOException e) {
            e.printStackTrace();
        }
        Test thread = new Test();
        int i = 0;
        while (i < 50) {
            thread.commitTrans();
            i++;
        }
    }
}
